//
//  YRJMySavedTableViewCell.m
//  YanRenjie
//
//  Created by dllo on 15/11/2.
//  Copyright (c) 2015年 yanrenjie. All rights reserved.
//

#import "YRJMySavedTableViewCell.h"
#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height

@implementation YRJMySavedTableViewCell
- (void)dealloc {
    [_savedImageView release];
    [_savedLabelOne release];
    [_savedLabelTwo release];
    
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createCell];
    }
    return self;
}

- (void)createCell {
    self.savedImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.savedImageView];
    [_savedImageView release];
    
    self.savedLabelOne = [[UILabel alloc] init];
    [self.contentView addSubview:self.savedLabelOne];
    [_savedLabelOne release];
    
    self.savedLabelTwo = [[UILabel alloc] init];
    [self.contentView addSubview:self.savedLabelTwo];
    [_savedLabelTwo release];
    self.savedLabelTwo.numberOfLines = 2;
    self.savedLabelTwo.font = [UIFont systemFontOfSize:12];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.savedImageView.frame = CGRectMake(0, 0, WIDTH / 3, HEIGHT);
    self.savedLabelOne.frame = CGRectMake(WIDTH / 3 + WIDTH / 20, HEIGHT / 7, WIDTH / 3 * 2 - WIDTH / 20, HEIGHT / 3);
    self.savedLabelTwo.frame = CGRectMake(WIDTH / 3 + WIDTH / 20, HEIGHT / 7 * 3, WIDTH / 3 * 2 - WIDTH / 20, HEIGHT / 7 * 4);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
